First try > Resetting the System Management Controller (SMC)
1. Shut down the computer.
2. Unplug the computer's power cord.
3. Wait fifteen seconds.
4. Attach the computer's power cord.
5. Wait five seconds, then press the power button to turn on the computer.
and the > About NVRAM and PRAM
1. Shut down the computer.
2. Locate the following keys on the keyboard: Command, Option, P, and R. You will need to hold these keys down simultaneously in step 4.
3. Turn on the computer.
4. Press and hold the Command-Option-P-R keys. You must press this key combination before the gray screen appears.
5. Hold the keys down until the computer restarts and you hear the startup sound for the second time.
6. Release the keys.
Then if it is still acting funny, you might have a loose RAM module and need to reinstall the modules as per > Mac mini: How to remove or install memory