Fixed the if-statements in the constructor