fixes #583 and other export issues

fixes #583