Bugfix: Unclosed if statement