Fix small bugs
Small change to code