Fixed some constructors and performed slight refactoring.