A couple optimizations / fixes