Minor bugs and changes