Fixed bug found by @MichaelHipp