fix fpath variable and missed imports
add wrong byte value message