Fixes from code inspection