fixed github issues #1 and #2 -- thanks Phil!