Bugs fixed after Code Review