Fixed minor bug and initial test