Minor changes
Minor changes

Minor bugfixes and code cleanup