Minor fixes in code