Fixed Conditional and refactored

https://code.google.com/p/otwarchive/issues/detail?id=3794