Fixed bug (thanks Luke)