fixed some build compatibility issues