Minor performance improvements (Fixes #12)