Some small fixes and improvments