Minor fixes and improvments