minor optimizations and corrections