Fixing host setup and apply, further optimizations. Relates to #11