fixed silly initialization issue that caused a memory allocation error
added test for initialization