fixed that nasty crashing bug in wavefront.cpp