Mostly fixes for "as"

These fixes address issue #5