added test via console and minor fixes