fix nested switch statments (fixes #68)