Commit work-in-progress on fixing a few issues -- needs more testing!