Minor bugs in last commit