Few bugs fixed after testing toplevel