logic fixes

fixed most of the issues in the first few functions where functions
weren't supposed to return null on a positive result