Change accessing a property on a non-object to throw a notice

This fixes issue #1905