Fixed exception in weird code.