Fixes and minor structural changes.