stackoverflow fixes + some corrections