Added NullPointerExceptions to appropriate methods