Fixing bugs from last commit