Fixed issues with type checking objects in ShMemObject. Use instanceof instead of type