better tests, better handling of undefined & null vars/options