Fixed NullReferenceExceptions on empty blocks