Fixes for format detection