Some minor fixes, added hasOwnProperty