Performance tweaks #2
Fix #5