Added tests for if/elseif/else and fixed bugs