Fixed numerous logic errors in StandardFragment.java.