some bug fixes and small adjustments