Added functions for extension checking etc.