Wine fixes and minor code cleanup...