Fixes here and there for timing and variable initialization :(