Code fixes after testing