Add hasOwnProperty to mitigate #28, general cleanup