Fixes calculating, error printing