Minor bug fixes in last commit