Too many #end ifs

Hate merging