Fixed a couple of bugs and merged with distro build