Bug fixes for 1.0.4/2.0.4 submission