Added better support for custom objdir