fixes a few issues to avoid common errors