Fixes, performance tweaks
Merge pull request #12 from hfaran/perf1

Perf1