Fixed up some parsing bugs and added parsing for match as.