various bug fixes...