Various small fixes

Remove unused globals
Just return instead of return false as nothing is checking the output
Actually use the $size variable that's instantiated