Fixed Dmitri's `main` functions.