Quick bug fixes

Small kinks in the code that have been fixed.