Small bugfix, and small fixes, per joepie91's comments