Got rid of stupid error. Forgotten to free file stream handle.