Fixing some errors

A few things weren't returning proper values, so I fixed that.