Fixing function base cases