Changing constructors to avoid NullPointerException