Fixed some line drawing bugs, added ex handling