various fixes
bug fixes, entropy rate, cleanup