more fixups

This addresses the issues discussed in #2 and also makes some fixes to get vectorized operations working.