fixed test & added special case optimizations to VM