Various improvments/fixes