diff --git a/vala/valagenieparser.vala b/vala/valagenieparser.vala
index 7abd943..3e8411a 100644
--- a/vala/valagenieparser.vala
+++ b/vala/valagenieparser.vala
@@ -427,6 +427,12 @@ public class Vala.Genie.Parser : CodeVisitor {
 		return sym;
 	}
 
+	void skip_whitespace () {
+		while (accept (TokenType.EOL) ||
+			accept (TokenType.INDENT) ||
+			accept (TokenType.DEDENT)) {}
+	}
+
 	void skip_type () throws ParseError {
 
 		accept (TokenType.DYNAMIC);
@@ -633,26 +639,29 @@ public class Vala.Genie.Parser : CodeVisitor {
 	}
 
 	Expression parse_argument () throws ParseError {
+		skip_whitespace ();
 		var begin = get_location ();
-
+		Expression result;
 		if (accept (TokenType.REF)) {
 			var inner = parse_expression ();
-			return new UnaryExpression (UnaryOperator.REF, inner, get_src (begin));
+			result = new UnaryExpression (UnaryOperator.REF, inner, get_src (begin));
 		} else if (accept (TokenType.OUT)) {
 			var inner = parse_expression ();
-			return new UnaryExpression (UnaryOperator.OUT, inner, get_src (begin));
+			result = new UnaryExpression (UnaryOperator.OUT, inner, get_src (begin));
 		} else {
 			var expr = parse_expression ();
 			var ma = expr as MemberAccess;
 			if (ma != null && ma.inner == null && accept (TokenType.COLON)) {
 				// named argument
 				expr = parse_expression ();
-				return new NamedArgument (ma.member_name, expr, get_src (begin));
+				result = new NamedArgument (ma.member_name, expr, get_src (begin));
 			} else {
-				return expr;
+				result = expr;
 			}
 
 		}
+		skip_whitespace ();
+		return result;
 	}
 
 	Expression parse_primary_expression () throws ParseError {
@@ -1136,10 +1145,14 @@ public class Vala.Genie.Parser : CodeVisitor {
 	}
 
 	MemberInitializer parse_member_initializer () throws ParseError {
+		skip_whitespace ();
 		var begin = get_location ();
 		string id = parse_identifier ();
+		skip_whitespace ();
 		expect (TokenType.ASSIGN);
+		skip_whitespace ();
 		var expr = parse_expression ();
+		skip_whitespace ();
 
 		return new MemberInitializer (id, expr, get_src (begin));
 	}
@@ -1766,6 +1779,9 @@ public class Vala.Genie.Parser : CodeVisitor {
 				case TokenType.NEW:
 					stmt = parse_expression_statement ();
 					break;
+				case TokenType.EOL:
+					next ();
+					continue;
 				default:
 					bool is_expr = is_expression ();
 					if (is_expr) {
@@ -1925,8 +1941,10 @@ public class Vala.Genie.Parser : CodeVisitor {
 			} else {
 				var s = parse_identifier ();
 				add_local_var_variable (block, s);
+				if (!current_expr_is_lambda) {
 					expect_terminator ();
 				}
+			}
 
 			return;
 		}
@@ -1951,9 +1969,10 @@ public class Vala.Genie.Parser : CodeVisitor {
 			var local = parse_local_variable (type_copy, id);
 			block.add_statement (new DeclarationStatement (local, local.source_reference));
 		}
-
+		if (!current_expr_is_lambda) {
 			expect_terminator ();
 		}
+	}
 
 	LocalVariable parse_local_variable (DataType? variable_type, string id) throws ParseError {
 		var begin = get_location ();
@@ -2222,7 +2241,9 @@ public class Vala.Genie.Parser : CodeVisitor {
 		if (current () != TokenType.SEMICOLON && current () != TokenType.EOL) {
 			expr = parse_expression ();
 		}
+		if (!current_expr_is_lambda) {
 			expect_terminator ();
+		}
 		return new ReturnStatement (expr, get_src (begin));
 	}
 
diff --git a/vala/valageniescanner.vala b/vala/valageniescanner.vala
index e2c5466..f1077c7 100644
--- a/vala/valageniescanner.vala
+++ b/vala/valageniescanner.vala
@@ -59,7 +59,12 @@ public class Vala.Genie.Scanner {
 		public bool skip_section;
 	}
 
-	State[] state_stack;
+	struct StateStackItem {
+		public State state;
+		public int indent;
+	}
+
+	StateStackItem[] state_stack;
 
 	enum State {
 		PARENS,
@@ -94,11 +99,11 @@ public class Vala.Genie.Scanner {
 	}
 
 	bool in_template () {
-		return (state_stack.length > 0 && state_stack[state_stack.length - 1] == State.TEMPLATE);
+		return (state_stack.length > 0 && state_stack[state_stack.length - 1].state == State.TEMPLATE);
 	}
 
 	bool in_template_part () {
-		return (state_stack.length > 0 && state_stack[state_stack.length - 1] == State.TEMPLATE_PART);
+		return (state_stack.length > 0 && state_stack[state_stack.length - 1].state == State.TEMPLATE_PART);
 	}
 
 	bool is_ident_char (char c) {
@@ -106,7 +111,7 @@ public class Vala.Genie.Scanner {
 	}
 
 	bool in_regex_literal () {
-		return (state_stack.length > 0 && state_stack[state_stack.length - 1] == State.REGEX_LITERAL);
+		return (state_stack.length > 0 && state_stack[state_stack.length - 1].state == State.REGEX_LITERAL);
 	}
 
 	SourceReference get_source_reference (int offset, int length = 0) {
@@ -686,16 +691,25 @@ public class Vala.Genie.Scanner {
 						len++;
 					}
 					type = TokenType.IDENTIFIER;
-					state_stack += State.TEMPLATE_PART;
+					state_stack += StateStackItem() {
+						state = State.TEMPLATE_PART,
+						indent = current_indent_level
+					};
 				} else if (current[0] == '(') {
 					current++;
 					column += 2;
-					state_stack += State.PARENS;
+					state_stack += StateStackItem() {
+						state = State.PARENS,
+						indent = current_indent_level
+					};
 					return read_token (out token_begin, out token_end);
 				} else if (current[0] == '$') {
 					type = TokenType.TEMPLATE_STRING_LITERAL;
 					current++;
-					state_stack += State.TEMPLATE_PART;
+					state_stack += StateStackItem() {
+						state = State.TEMPLATE_PART,
+						indent = current_indent_level
+					};
 				} else {
 					Report.error (get_source_reference (1), "unexpected character");
 					return read_template_token (out token_begin, out token_end);
@@ -759,7 +773,10 @@ public class Vala.Genie.Scanner {
 					state_stack.length--;
 					return read_token (out token_begin, out token_end);
 				}
-				state_stack += State.TEMPLATE_PART;
+				state_stack += StateStackItem() {
+					state = State.TEMPLATE_PART,
+					indent = current_indent_level
+				};
 				break;
 			}
 		}
@@ -775,7 +792,6 @@ public class Vala.Genie.Scanner {
 		return type;
 	}
 
-
 	public TokenType read_token (out SourceLocation token_begin, out SourceLocation token_end) {
 
 
@@ -821,13 +837,6 @@ public class Vala.Genie.Scanner {
 			skip_space_tabs ();
 		}
 
-		/* handle automatic line continuations (when inside parens or braces) */
-		while (current < end && current[0] == '\n' && (open_parens_count > 0 || open_brace_count > 0)) {
-			current++;
-			line++;
-			skip_space_tabs ();
-		}
-		
 
 		/* handle non-consecutive new line once parsing is underway - EOL */
 		if (newline () && parse_started && last_token != TokenType.EOL && last_token != TokenType.SEMICOLON) {
@@ -899,7 +908,10 @@ public class Vala.Genie.Scanner {
 			if (current < end - 1 && current[1] == '"') {
 				type = TokenType.OPEN_TEMPLATE;
 				current += 2;
-				state_stack += State.TEMPLATE;
+				state_stack += StateStackItem() {
+					state = State.TEMPLATE,
+					indent = current_indent_level
+				};
 			} else {
 				token_begin.pos++; // @ is not part of the identifier
 				current++;
@@ -966,13 +978,17 @@ public class Vala.Genie.Scanner {
 			case '{':
 				type = TokenType.OPEN_BRACE;
 				open_brace_count++;
-				state_stack += State.BRACE;
+				state_stack += StateStackItem() {
+					state = State.BRACE,
+					indent = current_indent_level
+				};
 				current++;
 				break;
 			case '}':
 				type = TokenType.CLOSE_BRACE;
 				open_brace_count--;
 				if (state_stack.length > 0) {
+					indent_level = state_stack[state_stack.length - 1].indent;
 					state_stack.length--;
 				}
 				current++;
@@ -980,7 +996,10 @@ public class Vala.Genie.Scanner {
 			case '(':
 				type = TokenType.OPEN_PARENS;
 				open_parens_count++;
-				state_stack += State.PARENS;
+				state_stack += StateStackItem() {
+					state = State.PARENS,
+					indent = current_indent_level
+				};
 				current++;
 				break;
 			case ')':
@@ -988,6 +1007,7 @@ public class Vala.Genie.Scanner {
 				open_parens_count--;
 				current++;
 				if (state_stack.length > 0) {
+					indent_level = state_stack[state_stack.length - 1].indent;
 					state_stack.length--;
 				}
 				if (in_template ()) {
@@ -996,12 +1016,16 @@ public class Vala.Genie.Scanner {
 				break;
 			case '[':
 				type = TokenType.OPEN_BRACKET;
-				state_stack += State.BRACKET;
+				state_stack += StateStackItem() {
+					state = State.BRACKET,
+					indent = current_indent_level
+				};
 				current++;
 				break;
 			case ']':
 				type = TokenType.CLOSE_BRACKET;
 				if (state_stack.length > 0) {
+					indent_level = state_stack[state_stack.length - 1].indent;
 					state_stack.length--;
 				}
 				current++;
@@ -1196,7 +1220,10 @@ public class Vala.Genie.Scanner {
 				case TokenType.PLUS:
 				case TokenType.RETURN:
 					type = TokenType.OPEN_REGEX_LITERAL;
-					state_stack += State.REGEX_LITERAL;
+					state_stack += StateStackItem() {
+						state = State.REGEX_LITERAL,
+						indent = current_indent_level
+					};
 					current++;
 					break;
 				default:
