From code review: Added getters and improved null-handling.