Improve the ensure attribute method to check for type, and allow for checking from a location