Bug fixes, improvments