minor bug fixes in main form