Fixes in internal logic