Bug fixes and work on scaffolds