Fix for byte-compile warnings
Check whether buffer is related to file