fixed handling of binary resources