Fixed 2 bugs