Includes fixes for bug #564 #565 + Includes all the patches from PR #295