Fix parsing of MAGIC_SELECT, MAGIC_CASE_BEGIN, MAGIC_CASE_END and fix bug from previous commit